package com.example.jiangzhu.mvpdemo.model;

import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;

/**
 * Created by jiang zhu on 2018/4/5.
 */

public class UserModel implements IUserModel{


    @Override
    public void login(String name, String pwd, ILoginListener loginListener) {
        if (TextUtils.isEmpty(name)||TextUtils.isEmpty(pwd)){
            loginListener.onError();
            return;
        }
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        if ("123".equals(name)&&"456".equals(pwd)){
            loginListener.onSucess();
        }else {
            loginListener.onFail();
        }

    }
}
